package com.whg.demo.biz;

import com.whg.demo.model.User;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author whg
 * @create 2022/12/15 14:51
 * @description：
 */
@Component
public class StaticUserTwo {

    private static volatile User twoUser = null;

    public StaticUserTwo(){

    }

    public User getUser(){
        if(twoUser == null){
            synchronized (User.class){
                if(null == twoUser){
                    twoUser = new User("xxx","15797897837",new Date(),24,"88888");
                }
            }
        }
        return twoUser;
    }
}
